home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / comp / longroad < prev    next >
Encoding:
Text File  |  1993-06-20  |  15.1 KB  |  288 lines

  1. THE LONG ROAD AHEAD
  2. Difficulties in Machine Intelligence
  3.  
  4.  
  5. by
  6. Peter Dudey (pdudey@willamette.edu, hagbard on the IGS)
  7.  
  8.  
  9. a Willamette University
  10. Undergraduate Research Grant
  11.  
  12.  
  13.  
  14. 28 August 1992
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. ACKNOWLEDGEMENTS
  30.  
  31.     I would like to thank the University for funding me in this 
  32. work, and Professor Jim Levenick for advising me.  I was greatly 
  33. aided by the insights of David Fotland and the other programmers at 
  34. the North American Computer Go Championship, and the Go players 
  35. on the Internet Go Server who tested an commented on Fumiko.  All 
  36. those involved in setting up the server and maintaining the Go 
  37. directory at the University of Washington were also helpful.
  38.     Finally, I would like to thank Ian Osgood for joining me in my 
  39. continued work.
  40.  
  41. GENERAL OUTLINE
  42.  
  43.     I have spent the past three months applying machine learning
  44. techniques to the Japanese game of Go.  I have learned a great deal
  45. about Go, programming in general, Go programming in particular, and
  46. intelligence.  My insights on these last two topics are delineated in
  47. "On Intelligence And Learning."
  48.     I have produced a working Go program, "Fumiko", which can be 
  49. found on the public Go directory at the University of Washington 
  50. computer system (milton.u.washington.edu on the internet).  The 
  51. program is somewhat competent, and defeated David Stoutamire's 
  52. "Goprogram" in an untimed game over the internet.  Fumiko is rather 
  53. slow, though, and lost all of her rounds at the North American 
  54. Computer Go Championship, held here in August at the U.S. Go 
  55. Congress, by running out of time.  (I gave Fumiko a feminine name, 
  56. and use such pronouns, because she would usually play black, and by 
  57. Taoist symbolism black is feminine.)  Fumiko was never able to 
  58. learn;  this turned out to be too massive a problem, for reasons that 
  59. will be explained in the section entitled "Why Is This So Difficult?".
  60.     Although Fumiko was only completed in early August, I have 
  61. learned so much, in writing her and at the Congress, that in 
  62. retrospect she seems primitive and clumsy.  (By comparison with the 
  63. other programs in the Championship, she was.)  Although the period 
  64. of this grant is ending, I am continuing my work:  I am working with 
  65. Ian Osgood, a programmer from Beaverton, on a new program, 
  66. "HellGo".  This is discussed in greater detail in "Future Work."
  67.  
  68. ON INTELLIGENCE AND LEARNING
  69.  
  70.     In the machine learning class I took from Professor Levenick 
  71. last semester, a great deal of time was spent on the question of what 
  72. it means to be intelligent.  I believe intelligence involves the ability 
  73. to ask oneself and answer three questions:
  74.     1)  What's going on?
  75.     2)  What should I do?
  76.     3)  How should I do this?
  77.     The third question may be applied to itself recursively.  If a 
  78. person decides they want to get rich by selling widgets, they must 
  79. ask themselves how they are going to sell them.  If they decide to 
  80. sell them by advertising in the back of Soldier of Fortune magazine, 
  81. they must consider how to go about placing such an ad.
  82.     For a program to learn, it must be able to answer an additional 
  83. question:
  84.     4)  What effect will this have?
  85.     When this question is answered, a prediction is being made, 
  86. and this allows for use of the scientific method:  make a prediction, 
  87. test it (by performing the action decided upon), correct the 
  88. prediction to whatever extent it didn't hold, and repeat the process.
  89.     Correcting the prediction is the essence of learning.  If a person 
  90. or program keeps making the same wrong prediction, they are 
  91. certainly not learning.  How to make such a correction, however, is a 
  92. diabolically difficult problem.
  93.     The primitive learning algorithms we implemented in the 
  94. machine learning class had it fairly easy;  after they chose an action 
  95. (implicitly predicting that this was the right answer), we would tell 
  96. them what they should have done.  If they got it wrong, they would 
  97. alter their action-choosing mechanism to be more likely to choose 
  98. that answer if faced with the exact same problem.  This learning 
  99. would generalize somewhat, in that the programs would usually then 
  100. respond in a similar way to similar problems.
  101.     In Go, things are not so simple, for two reasons:  we don't know 
  102. the "right" answer, and the situation is so complex that it's difficult to 
  103. tell exactly what went wrong.
  104.     In a simple game like Tic-Tac-Toe, it may be said that a move 
  105. is right or wrong:  correct moves lead to victory (or at least a tie), 
  106. incorrect moves to defeat.  Most humans, and simple computer 
  107. programs, can work out every possible sequence of moves up to the 
  108. end of the game.  If a move will lead to the player winning 
  109. regardless of how the opponent responds, it may be said to be the 
  110. correct move.
  111.     A human cannot do this with a game like Chess.  There are 
  112. simple too many possibilites--there are roughly 10^450 possible 
  113. games.
  114.     One may just try to "look ahead" further than the opponent, 
  115. and make moves which will lead to a good board position.  This, 
  116. however, depends on being able to accurately judge how good a 
  117. board position is.  If one is going to consider three moves that each 
  118. player might make, for each of the next ten turns, one must perform 
  119. 310 such judgements.
  120.     The best Chess programs do work by brute force: looking ahead 
  121. many more moves than the opponent and using special-purpose 
  122. hardware to make simple judgements of how good a board position is 
  123. (e.g., counting pieces).
  124.     This approach does not work in Go.  The number of possible 
  125. games is vastly higher (10^750), there are more legal moves in a turn 
  126. (several hundred, compared to a dozen or so in Chess), there are 
  127. more moves in a game (around 300, compared to about 40), and 
  128. judging a board position is much more difficult.  (This last has to do 
  129. with the more significant interplay between pieces in Go.)
  130.     Not only can we not tell a Go program what the right answer is, 
  131. deciding on a move is a sufficiently complicated process that it is 
  132. difficult to say exactly what went wrong.
  133.     By way of analogy, suppose a woman walks into the street and 
  134. is hit by a truck.  She survives, and when she awakes in the hospital 
  135. her husband tells her, "I hope you learned your lesson!"
  136.     What is the lesson to be learned?  Why did she fail in her task 
  137. of not being hit by a truck?  Did she fail to look both ways before 
  138. crossing the street?  Did she look, but not see the truck because she 
  139. wasn't wearing her glasses?  Was her timing off in running ahead of 
  140. or behind the truck?  Did she fail to put on high-visibility clothes 
  141. that morning?  Was it not her fault at all, but that of the truck 
  142. driver?  Was it some combination of these?  Is her husband correct 
  143. in telling her to change her behavior, or does he think the accident 
  144. was divine retribution for some otherwise unrelated action?
  145.     If something bad happens in a Go game (a group is captured or 
  146. the game is lost), there is often not one particular move to blame.  
  147. Also, when a bad move is made, the consequences may not be 
  148. immediately apparent, as with the woman choosing not to wear her 
  149. Day-Glo vest that day and then being flattened several hours later.
  150.     Even if a bad move can be spotted, it is not always clear why it 
  151. was bad.  It may have been a bad way to attempt to save a group, or 
  152. it may have saved the group but nonetheless been a bad move 
  153. because it ignored some other, more urgent situation elsewhere on 
  154. the board.  Finding the weak link(s) in a chain of reasoning is 
  155. difficult even for humans.
  156.     Finally, even if we can find out what went wrong and why it 
  157. was wrong, current computer programs are not good at figuring out 
  158. how to change the offending behavior.  The approach being most 
  159. rigorously explored right now involves telling the program to, in the 
  160. future, rely more on those parts that tend to offer good advice.  This 
  161. does not create any new solutions to the lowest-level problems, but 
  162. makes the best possible use of those techniques the program has.
  163.     Fortunately, in a limited realm such as a game, there is a level 
  164. at which the program doesn't need to find new ways to do things, 
  165. and there are things it will always want to do.  The rules of the game 
  166. provide a finite list of possible ways to try to do anything (the legal 
  167. moves), and the overriding goal is always to win the game.  There 
  168. would be no point in the program being able to override these limits.  
  169. In larger contexts, such as life itself, it can be argued that there are 
  170. no such limits;  there are always new ways to do something, and we 
  171. haven't found any places to stop asking, "Why?"  A program that did 
  172. not have upper and lower limits on these chains of reasoning would 
  173. not merely be intelligent, it would be sentient.
  174.  
  175.  
  176. WHY IS THIS SO DIFFICULT?
  177.  
  178.     One thing I have gained from this project is an appreciation of 
  179. the sheer immensity of the problem of computer Go.  Playing the 
  180. game has provided careers for generations of professionals;  the best 
  181. programs, which are over 80,000 lines long and encompass decades 
  182. of person-years of work, play only as moderate amateurs.
  183.     Why, one might wonder, is Go so difficult to program?  Why 
  184. can't we just ask a master player how they choose their moves, and 
  185. then use the computers calculating power better and faster?
  186.     The biggest reason is that good players don't know why they 
  187. choose the moves they choose.  If asked, they will often respond, "It 
  188. just looked right."
  189.     I have found three particular obstacles, things which even 
  190. begining human players do better than any extant programs:  
  191. grouping, spotting salient details, and making intuitional judgements.
  192.     By grouping, I mean recognizing groups of stones which are 
  193. near each other and not cut apart by enemy stones.  Even an 
  194. amateur can perform this task instantaneously and with a fairly high 
  195. degree of accuracy.
  196.     This is difficult to program because of the vagueness of such 
  197. concepts as "near".  In Go, pairs of stones can be more distant than 
  198. individual stones and still be in the same group, and enemy stones in 
  199. the area have an effect which is hard to explicitly define.  Even if a 
  200. threshold distance is known, finding the distance between two stones 
  201. would involve the Pythagorean theorem;  this only takes a fraction of 
  202. a second, but if it must be done several thousand times a turn it can 
  203. be cripplingly slow.
  204.     People are also very good at spotting things which are 
  205. important or different.  Although we ignore most of the cars we see 
  206. on the road, we could spot a police car instantly.  The most efficient 
  207. way for a computer to spot it would be to check every car seen.  It is 
  208. not clear whether humans are doing this subconsciously, but if we 
  209. are we are simultaneously doing that and thousands of other things 
  210. (checking for odd smells, looking for anyone we know, listening to 
  211. the radio, watching street signs . . . ) at amazing speed.
  212.     Within a field, this ability to jump straight to the important 
  213. part is what makes for expertise.  A musician can immediately pick 
  214. out the melody in a song, ignoring the other notes.  An English 
  215. teacher can spot spelling errors in a ten-page essay;  if he is checking 
  216. every word against some internal dictionary, he's doing it fast 
  217. enough that he still has time to comprehend the essay and look for a 
  218. thesis.  A Go player needn't try to defend a group that isn't 
  219. threatened, and doesn't consciously check each group every turn.
  220.     Because we don't process (or process very quickly) most of the 
  221. information that comes our way, we can make snap judgements, 
  222. coming up with a good answer without having complete information.
  223.     For example, if a person unwittingly bites into a jalapeo, they 
  224. can instantly grab a glass of water and quaff it.  From a programming 
  225. standpoint, this involves going through the list of items on the table, 
  226. comparing the quenching potential of water with that of other 
  227. available beverages, considering whether the clear liquid is in fact 
  228. hydrochloric acid, and so on.  Whether the person is not doing this or 
  229. is doing it very quickly is not clear.
  230.     One type of snap judgement particularly useful in Go is the 
  231. ability to spot the few good moves.  After a few seconds, a player 
  232. will have discarded all but two or three of the hundreds of legal 
  233. moves.  Again, they are not consciously going through each possible 
  234. move;  they are thinking, "I either want to do this, or that, or that."  
  235. Here, perhaps, is an area where computers have the advantage:  a 
  236. person could not remember analyses of fourteen possible moves.
  237.     In writing Fumiko, I spent most of my time on the sequencer, 
  238. the part which would read out possible sequences of plays.  At the 
  239. Congress, Dave Fotland pointed out that this was not a good idea.  
  240. Reading out sequences is very time-consuming, and time spent 
  241. considering consequences of dumb moves is essentially wasted.  Most 
  242. of the better programs concentrate on selecting moves to consider.  If 
  243. a program can spot a half-dozen good moves intuitionally, even 
  244. playing one of those at random is not likely to mess up the game 
  245. horribly.  When professional Go players take on several opponents at 
  246. once, they may be doing something akin to this.
  247.     While they are much faster, snap judgements are not as 
  248. accurate as complete analysis, and can lead to closed-mindedness.  If 
  249. the best answer is unorthodox, it may never be considered, may be 
  250. thrown out with the bad answers.  Often, as in the jalapeo example, 
  251. we don't have time to perform a complete analysis;  other times, we 
  252. don't have enough information on the topic (as in judging a person), 
  253. and we really don't have time to fully analyze all of the information 
  254. we get, which is why we must ignore so much of it.  An intelligence 
  255. must walk a fine line;  too much analysis takes too long, and too little 
  256. may miss the best answers--especially if our intuitions are flawed.
  257.  
  258. FUTURE WORK
  259.  
  260.     As mentioned in the introduction, this will not be the end of 
  261. my work in computer Go.  Work on "HellGo" has commenced, and it 
  262. will feature several improvements over Fumiko:
  263.     First, and perhaps most importantly, the data structures will be 
  264. smaller, faster, and more efficient.  This is made possible by the 
  265. programming experience I have gained working on Fumiko, and on 
  266. the advantage of having a collaborator.  To give just one example, the 
  267. structure used to store the locations of the stones on the board is 
  268. nearly six times smaller than it used to be, and appears to be a little 
  269. faster.
  270.     We will not ignore the grouping question, as I did with Fumiko.  
  271. Already, HellGo has a loose concept of groups, and we will be 
  272. improving this, writing sections to detect whether stones or chains of 
  273. stones are connected.
  274.     More emphasis will be put on the move selector, the part which 
  275. decides which moves should be considered in reading out sequences.  
  276. These parts in Fumiko were rather sloppily thrown together as the 
  277. Congress approached, and she relied on the sequence reader--a bad 
  278. idea for reasons explained earlier.
  279.     We do hope to get HellGo to learn, or at least be teachable.  
  280. Currently, I envision a program where, if it made a bad move, the 
  281. human opponent could ask it why it did so, and then point out the 
  282. weak link in a displayed chain of reasoning.
  283.     Finally, we will be spending more time on this program than I 
  284. was able to spend on Fumiko;  it may be several years before it is 
  285. completed.  We intend to seek further funds from other sources to 
  286. continue our work.  In any case, I for one will be doing this in my 
  287. spare time for the forseeable future.
  288.